# 输入
string=input("请输入一行字符串:")
count1,count2,count3,count4=0,0,0,0
# 遍历字符串每个字符
for str in string:
    if str.isalpha():
        count1+=1
    elif str.isdigit():
        count2+=1
    elif str.isspace():
        count3+=1
    else:
        count4+=1
print(f"这段字符串中字母{count1}个，数字{count2}个，空格{count3}个，其他字符{count4}个")



